#coding=utf-8
from flask import Flask,url_for,request,render_template
app=Flask(__name__)

@app.route('/')
def index():
    return 'Index Page'

@app.route('/hello')
@app.route('/hello/<name>')
def hello(name=None):
    return render_template('hello.html',name=name)

# url变量

@app.route('/user/<username>')
def show_user_profile(username):
    return 'User %s'%username

@app.route('/post/<int:post_id>')
def show_post(post_id):
    return 'Post %d' % post_id

#url斜杠

@app.route('/projects/')
def projects():
    return 'The project page'

@app.route('/about')
def about():
    return 'The about page'

@app.route('/login',methods=['GET,POST'])
def login():
    if request.method=='POST':
        pass
    else:
        pass

# url_for('static')

if __name__=='__main__':
    app.debug = True
    app.run(host='0.0.0.0')